/*
 *  Copyright 2008 Mark Ashworth <javameme@gmail.com>.
 *
 *  Licensed under the GNU General Public License v3 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.gnu.org/licenses/gpl-3.0.html
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package xperiment.metaphor.model.security;

import xperiment.metaphor.model.DomainObject;
import xperiment.metaphor.model.Persistent;

/**
 *
 * The following is taken from Spring Security 2.0.3<br />
 * <code>
 * CREATE TABLE ACL_SID(<br />
 * ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY,<br />
 * PRINCIPAL BOOLEAN NOT NULL,<br />
 * SID VARCHAR_IGNORECASE(100) NOT NULL,<br />
 * CONSTRAINT UNIQUE_UK_1 UNIQUE(SID,PRINCIPAL));<br />
 * </code>
 * @author Mark Ashworth <javameme@gmail.com>
 * @version 1.0.0
 * @since 1.0.0
 */
public class ACLSecurityId extends DomainObject implements Persistent {

    private Long id;
    private String sid;
    private boolean principal;

    public ACLSecurityId() {
        this(null, true);
    }

    public ACLSecurityId(String sid) {
        this(sid, true);
    }

    public ACLSecurityId(String sid, boolean principal) {
        this.sid = sid;
        this.principal = principal;
    }

    public Long getId() {
        return id;
    }

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public boolean isPrincipal() {
        return principal;
    }

    public void setPrincipal(boolean principal) {
        this.principal = principal;
    }

    public boolean isEnabled() {
        return true;
    }
}
